#pragma once

#include <vector>
#include "../shared/geom.h"


typedef std::vector<Vector2f> type_VectorList;

/**
=================================
A physics object is anything that moves and/or
needs updating of physical orientation
=================================
*/
class PhysicsObject
{
public:
    PhysicsObject(void);

    /** Update this object */
    void Update( float deltaTime );

    /** Get/Set the mass */
    void SetMass( float mass ) { m_fMass = mass; };
    float GetMass() const { return m_fMass; };

    /** Get/Set Velocity */
    void SetVelocity( const Vector2f &v ) { m_vVelocity = v; };
    Vector2f GetVelocity() const { return m_vVelocity; };

    /** Get/Set Position */
    void SetPosition( const Vector2f &v ) { m_vPosition = v; };
    Vector2f GetPosition() const { return m_vPosition; };

    /** Get/Set Acceleration */
    void SetAcceleration( const Vector2f &v ) { m_vAcceleration = v; };
    Vector2f GetAcceleration() const { return m_vAcceleration; };

    /** Add a force to this object */
    void ApplyForce( const Vector2f &f ) { m_forces.push_back( f ); };
    /** Add an impulse ( an impulse is a force only applied once in an update ) */
    void ApplyImpulse(const Vector2f &f ) { m_impulses.push_back( f ); };
private:
    // Mass of object
    float   m_fMass;
    // Velocity 
    Vector2f m_vVelocity;
    // Position
    Vector2f m_vPosition;
    // Acceleration
    Vector2f m_vAcceleration;
    // constant forces applied to this object
    type_VectorList     m_forces;
    // impulses applied - such as fake gravity
    type_VectorList     m_impulses;

public:
    virtual ~PhysicsObject(void);
};
